package cn.itcast.nems.manager.kc;

/**
 * KeyCloak 常量类
 *
 * @author JiangYanyu
 */
public class KeyCloakConstants {

    private KeyCloakConstants() {
    }

    /**
     * 基本参数相关
     */
    public static final String BEARER = "Bearer ";
    public static final String CLIENT_ID = "client_id";
    public static final String CLIENT_SECRET = "client_secret";
    public static final String USERNAME = "username";
    public static final String PASSWORD = "password";
    public static final String GRANT_TYPE = "grant_type";
    public static final String GRANT_TYPE_PASSWORD = "password";

    /**
     * 请求头相关
     */
    public static final String HEADER_AUTHORIZATION = "authorization";


    /**
     * 响应相关
     */
    public static final String ERROR_LOGIN_FAIL = "Invalid user credentials";
    public static final String ERROR = "error";
    public static final String SECRET = "secret";
    public static final String ERROR_DESCRIPTION = "error_description";


    /**
     * token相关
     */
    public static final String TOKEN_ACCESS_TOKEN = "access_token";
    public static final String TOKEN_EXPIRES_IN = "expires_in";
    public static final String TOKEN_REFRESH_EXPIRES_IN = "refresh_expires_in";
    public static final String TOKEN_REFRESH_TOKEN = "refresh_token";
    public static final String TOKEN_TOKEN = "token";
    public static final String TOKEN_ISS = "iss";
    public static final String TOKEN_AZP = "azp";
    public static final String TOKEN_PREFERRED_USERNAME = "preferred_username";
    public static final String TOKEN_ACTIVE = "active";
    public static final String TOKEN_SESSION_STATE = "session_state";

    /**
     * url占位符相关
     */
    public static final String URL_USER_ID = "{userId}";
    public static final String URL_SESSION_ID = "{sessionId}";
    public static final String URL_REALM = "{realm}";

    /**
     * KeyCloak 客户端应用类型
     */
    public static final String CLIENT_TYPE_CLIENT = "client";
    public static final String CLIENT_TYPE_BACK = "back";
}